import { EntitySchema } from '@mikro-orm/core';

export class LeOrderPay {
  id!: string;
  paySn!: string;
  orderList!: string;
  totalAmount!: string;
  payType?: boolean;
  status: boolean = false;
  AppID!: string;
  createdTime!: string;
  updatedTime?: string;
  deletedTime?: string;
  isDeleted: boolean = false;
}

export const LeOrderPaySchema = new EntitySchema({
  class: LeOrderPay,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    paySn: { type: 'string', length: 50 },
    orderList: { type: 'string', columnType: 'text' },
    totalAmount: { type: 'string', columnType: 'numeric(10,2)', defaultRaw: `0.00` },
    payType: { type: 'boolean', nullable: true },
    status: { type: 'boolean', default: false },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
    createdTime: { type: 'string', columnType: 'bigint' },
    updatedTime: { type: 'string', columnType: 'bigint', nullable: true },
    deletedTime: { type: 'string', columnType: 'bigint', nullable: true },
    isDeleted: { type: 'boolean', default: false },
  },
});
